<!--
 * @Descripttion: 资讯首页-文章列表模板
 * @version:
 * @Author: zyp
 * @Date: 2020-12-09 18:07:39
 * @LastEditors: zyp
 * @LastEditTime: 2021-06-23 13:55:13
-->
<template>
  <div class="titleHeight" :style="{ 'min-height': minHeights + 'px' }">
    <ul class="mui-table-view" v-if="!newListLength">
      <li
        v-for="(item, index) in list"
        :key="index"
        class="allListmodel"
        :id="item.id"
        @click="goDetail(item)"
      >
        <div
          class="datalist"
          applyid="20220224000008HT"
          fundcombination=""
          :fundcode="item.fundCode"
          :fundBusinCode="item.fundBusinCode"
          :fundName="item.fundName"
          :applydate="item.fundBusinCode"
          :data-hxtschannel="item.hxtsChannel"
        >
          <div class="first">
            <div class="tit ellipsis">{{ item.fundName }}</div>
            <div class="mon" v-if="(item.applyType==3 && item.autoBuy==0) || item.applyType==1">{{ item.sharesMask }}份</div>
            <div class="mon" v-else>{{ item.balanceMask }}元</div>
          </div>
          <div class="second">
            <div class="tim">{{ item.applyDate }} {{ item.applyTime }}</div>
            <div class="sta">{{ item.tradeApplyDesc }}</div>
          </div>
        </div>
      </li>
    </ul>
  </div>
</template>
<script>
import Base64 from "@/assets/js/base64.js";
import listLoadMore from "@/components/common/listLoadMore";
export default {
  name: "histories",
  components: { listLoadMore },
  props: {
    list: {
      type: [Object, Array],
      default: () => {},
    },

    minHeights: { type: Number, default: 1 },
    isFirstLoad: { type: Boolean, default: true },
    newListLength: { type: Boolean, default: true },
  },
  data() {
    return {
      listLength: 0,
    };
  },
  created() {},
  mounted() {},
  methods: {
     goDetail(item) {
         let params ={
             applyId: item.allotNo,
             fundCombination:item.fundCombination,
             fundCode:item.fundCode,
             fundBusinCode:item.fundBusinCode,
             allotType:item.applyType,
             fixbusinflag:item.fixbusinflag,
             fundType:item.fundType,
             scheduledProtocolId:item.scheduledProtocolId,
         }
         //分红需要传的
         let shares = item.autoBuy==0?item.sharesMask:item.balanceMask;
          // allotType == 3  是分红
         if (item.applyType == 3) {
             params.shares =item.shares;
             params.autoBuyDesc= encodeURI(new Base64().encode(item.autoBuyDesc));
             params.applyDate= item.applyDate;
             params.fundName=encodeURI(new Base64().encode(item.fundName))
         }
         this.$urls.routerPush(this, this.$urls.publicTradeDetail_url,params);
    },
  },
};
</script>
<style scoped lang="scss">
.mui-table-view {
  position: relative;
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 0;
  list-style: none;
  background-color: #fff;
  .datalist {
    background: #fff;
    padding: 0.28rem 0.3rem 0.31rem;
    border-bottom: 1px solid #e7e9ed;
    .first {
      display: flex;
      justify-content: space-between;
      .tit {
        color: #272727;
        height: 0.4rem;
        font-size: 0.28rem;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
        line-height: 0.4rem;
      }
      .mon {
        width: 30%;
        height: 0.45rem;
        font-size: 0.32rem;
        font-family: DIN-Medium, DIN;
        font-weight: 500;
        color: #272727;
        line-height: 0.36rem;
        text-align: right;
        white-space: nowrap;
      }
      .ellipsis {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }
    }
    .second {
      display: flex;
      justify-content: space-between;
      .tim {
        height: 0.33rem;
        font-size: 0.24rem;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #9b9b9b;
        line-height: 0.33rem;
      }
      .sta {
        height: 0.34rem;
        font-size: 0.24rem;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #9b9b9b;
        line-height: 0.33rem;
      }
    }
  }
}
</style>
